var fondo = {
	id: "fondo",

	visible: true,
	gameA: true,
	gameB: false,
	timer: 0,
	ran1: 0,
	
	init: function () {
	},

	update: function (delta) {
	
	this.timer += 1;
	
	if (this.timer == 33){
		this.ran1 = Math.floor((Math.random()*2)+1);
	}
	if(this.timer >= 66){
			this.ran1 = 0;
			this.timer = 0;
	}
	
	//console.log(this.ran1 + " " + this.timer + " " + this.timerBandera);	
	
	},

	draw: function (context) {
			
			context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image,
				218, 209, 240, 136,
				0, 0, 240, 136); // fondo
			if (this.gameA == true){
			context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image,
				209, 19, 24, 6,
				210, 0, 24, 6);} // gameA
			if (this.gameB == true){
			context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image,
				209, 27, 24, 6,
				210, 0, 24, 6);} // gameB
			if (this.ran1 != 1){
			context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image,
				68, 22, 21, 32,
				3, 8, 21, 32)}; //gato1
			if (this.timer > 33 && this.timer <= 66 && this.ran1 == 1){
			context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image,
				99, 23, 53, 39,
				3, 9, 53, 39);} //gato2
				
			context.fillStyle="Black";
			context.font="6px Arial";
			context.fillText("Puntos: ",5,5);
			
	},
};
